package com {
	import com.views.interfaces.ITip;
	import com.views.interfaces.map.IMapInstance;

	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.filters.ColorMatrixFilter;
	import flash.filters.GlowFilter;

	public class MapStatic extends Sprite {
		public static const NPCHitLen:int = 0x1900;
		public static const PortalHitLen:int = 10000;
		public static const MonsterHitLen:int = 2500;
		public static const BuildHitLen:int = 40000;

		public static var upZ:Boolean = false;
		public static var mapInstance:IMapInstance;
		public static var effectLayder:Sprite = new Sprite();
		public static var FolderScreen:String = "assets/roles/screen/";
		public static var FolderRole:String = "assets/roles/";
		public static var FolderEffects:String = "assets/roles/effects/";
		public static var FolderDrama:String = "assets/drama/";
		public static var FolderMap:String = "assets/map/";
		public static var FolderItemIcon:String = "assets/icons/goods/";
		public static var FolderNPCIcon:String = "assets/icons/npc/";
		public static var mapStage:Stage;
		public static var minW:int = 760;
		public static var minH:int = 590;
		public static var maxW:int = 760;
		public static var maxH:int = 590;
		public static var stageW:int = 760;
		public static var stageH:int = 590;
		public static var offX:int = 0;
		public static var offY:int = 0;
		public static var cf1:ColorMatrixFilter = new ColorMatrixFilter([0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0, 0, 0, 1, 0]);
		public static var cf2:ColorMatrixFilter = new ColorMatrixFilter([1, 0, 0, 0, 45, 0, 1, 0, 0, 45, 0, 0, 1, 0, 45, 0, 0, 0, 1, 0]);
		public static var gf1:GlowFilter = new GlowFilter(0, 1, 2, 2, 4, 1);
		public static var removeNickNameSuffix:Function;
		public static var getVersion:Function;
		public static var getRoleName:Function;
		public static var getRoleSign:Function;
		public static var iTip:ITip;

		public function MapStatic() {

		}

		public static function reposition():void {
			if (mapStage == null) {
				return;
			}
			stageW = getRange(mapStage.stageWidth, maxW, minW);
			stageH = getRange(mapStage.stageHeight, maxH, minH);
			offX = (stageW >> 1);
			offY = getRange(((stageH >> 1) + 70), 370, 270);
		}

		public static function getRange(_Current:int, _Max:int, _Min:int):int {
			if (_Current > _Max) {
				return (_Max);
			}
			if (_Current < _Min) {
				return (_Min);
			}
			return (_Current);
		}

	}

}
